package com.yanjiang;

import java.sql.ResultSet;
import java.sql.SQLException;

public class NewsDaoImp1 extends BaseDao implements NewsDao {
    @Override
    public void getNews() {
        try{
            String sql = "SELECT id,title FROM `news_detail`";
            Object[] objects = {};
            ResultSet re = BaseDao.selectObj(sql,objects);
            while (re.next()){
                int id = re.getInt("id");
                String title = re.getString("title");
                System.out.println(id + title);
            }

        }catch (SQLException e){
            e.printStackTrace();
        }
    }
}
